<?php
if ( ! empty($_COOKIE['user']) )
	header('Location: index.php');

if ( ! empty($_POST['user']) ) {
	setcookie('user', htmlentities(addslashes($_POST['user'])));
	header('Location: index.php');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
         "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>iGeoTrack</title>
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
<link rel="apple-touch-icon" href="./icon.png" />
<meta name="apple-touch-fullscreen" content="YES" />
<style type="text/css" media="screen">@import "./iui/iui.css";</style>
<script type="application/x-javascript" src="./iui/iui.js"></script>
</head>

<body>

    <div class="toolbar">
        <h1 id="pageTitle">iGeoTrack</h1>
        <a id="backButton" class="button" href="#"></a>
    </div>

    <form id="login" title="Log in" class="panel" selected="true" method="post" action="login.php" target="_self">
        <h2>What's your Last.fm username?</h2>
        <fieldset>
            <div class="row">
                <label>Username</label>
                <input type="text" name="user" id="user" value=""/>
            </div>
            <!--
            <div class="row">
                <label>Password</label>
                <input type="password" name="password" value=""/>
            </div>
            -->
        </fieldset>
        <a href="#" type="submit" class="whiteButton">Log in</a>
    </form>
	 
</body>
</html>